//
//  HomeHeaderCareCollectionViewCell.m
//  ZJControlsClass
//
//  Created by apple on 2024/10/28.
//

#import "HomeHeaderCareCollectionViewCell.h"

@interface HomeHeaderCareCollectionViewCell ()





@end



@implementation HomeHeaderCareCollectionViewCell


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        [self configUI];
        
        
        
    }
    return self;
}
-(void)configUI{
    [self.contentView addSubview:self.follewView];
    [self.follewView addSubview:self.titleLabel];
    [self.follewView addSubview:self.intoBtn];
    [self.follewView addSubview:self.img];
    
    [self.follewView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.contentView).with.offset(ALIGN_WIDTH_PT(5));
        make.right.bottom.equalTo(self.contentView).with.offset(-ALIGN_WIDTH_PT(5));
        
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.follewView).with.offset(ALIGN_WIDTH_PT(8));
        make.top.equalTo(self.follewView).with.offset(ALIGN_HEIGHT_PT(10));
        make.right.equalTo(self.follewView).with.offset(-ALIGN_WIDTH_PT(8));
        make.height.equalTo(@(ALIGN_HEIGHT_PT(20)));
    }];
    
    [self.intoBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel.mas_left);
        make.bottom.equalTo(self.follewView.mas_bottom).with.offset(-ALIGN_HEIGHT_PT(20));
        make.size.equalTo(@(CGSizeMake(ALIGN_WIDTH_PT(55), ALIGN_HEIGHT_PT(20))));
    }];
    
    [self.img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.right.equalTo(self.follewView).with.offset(-ALIGN_HEIGHT_PT(10));
        make.size.equalTo(@(CGSizeMake(ALIGN_WIDTH_PT(36), ALIGN_WIDTH_PT(36))));
    }];
    
    
    
}


#pragma mark -- 点击事件
//-(void)respondsTo_intoBtn:(UIButton *)sender{
//    __weak typeof(self)weakSelf = self;
//    if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(pushInfoViewController)]) {
//        [weakSelf.delegate pushInfoViewController];
//    }
//}



#pragma mark -- 懒加载
-(UIView *)follewView{
    if (!_follewView) {
        _follewView = [UIView new];
        _follewView.backgroundColor = [UIColor clearColor];
        _follewView.layer.cornerRadius = 5;
        _follewView.layer.masksToBounds = YES;
    }
    return _follewView;
}

-(UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [UILabel new];
        _titleLabel.textColor = [UIColor blackColor];
        _titleLabel.font = FONT14;
        _titleLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _titleLabel;
}

-(UIButton *)intoBtn{
    if (!_intoBtn) {
        _intoBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_intoBtn setTitle:@"立即办理" forState:UIControlStateNormal];
        [_intoBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _intoBtn.titleLabel.font = FONT11;
        _intoBtn.layer.cornerRadius = 10;
        _intoBtn.layer.masksToBounds = YES;
        _intoBtn.userInteractionEnabled = NO;
//        [_intoBtn addTarget:self action:@selector(respondsTo_intoBtn:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _intoBtn;
}

-(UIImageView *)img{
    if (!_img) {
        _img = [UIImageView new];
    }
    return _img;
}


@end
